package com.ruoyi.web.controller.basic;

import com.github.pagehelper.PageInfo;
import com.ruoyi.basic.service.AllclassService;
import com.ruoyi.system.domain.Result;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("basic/class")
public class AllclassController {
    @Autowired
    private AllclassService allclassService;
    /**
      * 查班级列表
      */
    @GetMapping("list")
    public Result find(@Param("pageNum") Integer pageNum, @Param("pageSize")Integer pageSize,@Param("classCode")Integer classCode,@Param("className")String className,@Param("leader")String leader,@Param("phone")String phone){
        Result result = new Result();
        PageInfo pageInfo = allclassService.find(pageNum,pageSize,classCode,className,leader,phone);
        result.setState(200);
        result.setMessage("获取成功");
        result.setData(pageInfo);
        return result;
    }

    /**
     * 查班级学生信息
     */
    @GetMapping("studentList")
    public Result findStudent(@Param("pageNum") Integer classCode){
        Result result = new Result();
        PageInfo pageInfo = allclassService.findStudent(classCode);
        result.setState(200);
        result.setMessage("获取成功");
        result.setData(pageInfo);
        return result;
    }

    /**
     * 查询在指定班级的出勤率
     *
     * */
//    @GetMapping("studentList")

}
